
package at.fhj.itm.metadata.impl;

import at.fhj.itm.metadata.Column;
import at.fhj.itm.metadata.MetadataItem;
import at.fhj.itm.metadata.SqlType;
import java.util.List;

/**
 *
 * @author Seuchter
 */
public abstract class AbstractColumn extends AbstractMetadataItem  implements Column{

    protected boolean isNotNull;
    protected boolean foreignKeyColumn;
    protected boolean primaryKeyColumn;
    
    protected SqlType columnType;
    protected String defaultValue;
    public AbstractColumn(String name, boolean  isNotNull, SqlType columnType, String defaultValue)
    {
            super(name);
            this.isNotNull = isNotNull;
            this.columnType = columnType;
            this.defaultValue = defaultValue;
    }
    public AbstractColumn(String name, boolean  isNotNull, 
    		SqlType columnType, String defaultValue, boolean primaryKeyColumn, boolean foreignKeyColumn)
    {
            this(name, isNotNull, columnType, defaultValue);
            this.primaryKeyColumn = primaryKeyColumn;
            this.foreignKeyColumn = foreignKeyColumn;
    }
    
    @Override
    public boolean isForeignKeyColumn() {
    	return foreignKeyColumn;
    }
    
    @Override
    public boolean isPrimaryKeyColumn() {
    	return primaryKeyColumn;
    }
    
    public String getDefaultValue(){
        return defaultValue;
    }

    public SqlType getColumnType()
    {
        return columnType;
    }

    public boolean isNotNull()
    {
        return isNotNull;
    }


    public List<? extends MetadataItem> getChildren()
    {
        return null;
    }

    

}
